home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / IBTip / Source / Tty.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  1.2 KB  |  42 lines

  1. #import <sgtty.h>
  2. #define NOPARITY (0)
  3. #define ILLEGAL_PARITY (99)
  4. #import <objc/Object.h>
  5.  
  6. /* the class Tty is for handling devices that are driven
  7.    by the general terminal interface -- see tty(4) */
  8.  
  9. @interface Tty:Object
  10. {
  11.   int fd;                      // file descriptor for reads and writes
  12.   int par;                     // parity (EVENP, ODDP, or NOPARITY)
  13.   struct sgttyb origState;     // for the reset method
  14.   struct sgttyb currentState;  // for calls to ioctl
  15. }
  16.  
  17. + newDevice:(char *)devname access:(int)flags;
  18. + newReadDevice:(char *)devname;
  19. + newWriteDevice:(char *)devname;
  20. + newReadWriteDevice:(char *)devname;
  21. + newExistingfd:(int)thisfd;  // for already existing file descriptor (eg. 0=stdin 1=stdout 2=stderr)
  22. - reset;
  23. - setEcho;
  24. - unSetEcho;
  25. - setRaw;
  26. - unSetRaw;
  27. - setCbreak;
  28. - unSetCbreak;
  29. - setCrmod;
  30. - unSetCrmod;
  31. - activateState;  // this is meant to be a private method
  32. - setSpeed:(int)bps;
  33. - setParity:(int)parity; //parity is either EVENP, ODDP, or NOPARITY
  34. - (int) getSpeed;
  35. - (int) getParity;
  36. - (int) getfd;
  37. - (int) queuedChars; //returns number of characters ready to be read
  38. - (int) readInto:(char *)buf;  //returns number of characters read into buf
  39. - (int) writeOut:(char *)buf;
  40.  
  41. @end
  42.